﻿using System.Windows.Input;
using MvvmFoundation.Wpf;

namespace WpfApplication6.ViewModel
{
    public abstract class CommandViewModel : ViewModel
    {
        private ICommand _command;

        public CommandViewModel()
        {
            Command = new RelayCommand(Execute, CanExecute);
        }

        public ICommand Command
        {
            get { return _command; }
            set
            {
                _command = value;
                RaisePropertyChanged("Command");
            }
        }

        protected abstract void Execute();

        protected abstract bool CanExecute();
    }
}